//  this library.
import 'package:flutter/material.dart';
import 'package:hktk_app/util/font_util.dart';
import 'package:hktk_app/util/view_util.dart';

/// 答题卡提示标签
class CardLabelWidget extends StatelessWidget {
  /// 是否显示夜间模式
  final bool? szYjms;

  const CardLabelWidget({super.key, this.szYjms = false});

  @override
  Widget build(BuildContext context) {

    return Row(
      mainAxisSize: MainAxisSize.min,
      children: [
        _showTips("未答", getColorGrey10(szYjms: szYjms!)),
        hiSpace(width: 10),
        _showTips("答对", getColorGreen10(szYjms: szYjms!)),
        hiSpace(width: 10),
        _showTips("答错", getColorRed5(szYjms: szYjms!)),
      ],
    );
  }

  /// 显示对应的提示
  _showTips(String tips, Color tipsColor) {
    return SizedBox(
      height: 46,
      child: Row(
        mainAxisSize: MainAxisSize.min,
        children: [
          Container(
            width: 18,
            height: 18,
            decoration: BoxDecoration(
              color: tipsColor,
              borderRadius: BorderRadius.all(Radius.circular(9)),
            ),
          ),
          hiSpace(width: 8),
          Text(
            tips,
            style: FontUtil.fontGrey11(18),
          ),
        ],
      ),
    );
  }
}
